﻿<!doctype html>
<html>
<head>
    <title>SpreadJS - Init Sheet</title>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>

    <link href="../../../external/spreadjs/css/gcspread.sheets.excel2013white.9.40.20161.0.css" rel="stylesheet" type="text/css" />

    <script src="../../../external/external/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../../external/spreadjs/gcspread.sheets.all.9.40.20161.0.min.js"></script>

    <script id="scriptInit" type="text/javascript">
        /*code_begin*/
        $(document).ready(function () {
            var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"));

            $("#btnAddSheet").click(function () {
                spread.addSheet(spread.getSheetCount());
            });

            $("#btnRemoveSheet").click(function () {
                if(spread.getSheetCount() > 0){
                    spread.removeSheet(0)
                }
            });

            $("#btnClearSheets").click(function () {
                spread.clearSheets();
            });
        });
        /*code_end*/
    </script>
</head>
<body>
    <div class="sample-turtorial">
        <div id="ss" style="width:100%; height:415px;border: 1px solid gray;"></div>
        <div class="demo-options">
	        <input type="button" value="Add sheet" id="btnAddSheet" />
            <input type="button" value="Remove sheet" id="btnRemoveSheet" />
            <input type="button" value="Remove all sheet" id="btnClearSheets" />
        </div>
    </div>
</body>
</html>